<template>
  <div id="app">
    <el-form :model="clazz" label-width="100px">

      <el-form-item label="发布新闻标题" prop="name">
        <el-input v-model="clazz.biaoti"></el-input>
      </el-form-item>


      <el-form-item label="详细描述">
        <el-input v-model="clazz.news"  type="textarea" rows="12"></el-input>
      </el-form-item>

      <el-form-item label="所属单位" prop="name">
        <el-input v-model="clazz.danwei"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click.prevent="test">发布</el-button>
      </el-form-item>
    </el-form>
  </div>

</template>

<script>
export default {
  data(){
    return {
      clazz:{},
      teacherList:[]
    }
  },
  created(){
    // this.axios.get("/baoguang/selectId/"+this.$route.query.id).then(resp=>{
    //   this.clazz=resp.data;
    // })
  },
  methods:{
    test(){
      this.$confirm("是否确认提交","发布提示").then(()=>{
        this.axios.post("/news/set",this.clazz).then((resp)=>{
          this.$message.success("发布成功！");
          this.$router.push("/student/ShowNews")
        });
      });
    }
  }
}
</script>


<style scoped>

</style>
